package se.webbzon.oschi01.nbt;

public class TagEvent {
	
	public enum Action {CHANGED, RENAMED, CHILD_ADDED, CHILD_REMOVED};
	
	private final Tag<?> source;
	private final Action action;
	private final int[] indicies;
	private final Object[] values;
	
	public TagEvent(Tag<?> source, Action action, Object value) {
		this(source,action,new int[] {-1}, new Object[] {value});
	}
	
	public TagEvent(Tag<?> source, Action action, int[] indicies, Object[] values) {
		this.source = source;
		this.action = action;
		this.indicies = indicies;
		this.values = values;
	}
	
	public Tag<?> source() {
		return source;
	}
	
	public Action getAction() {
		return action;
	}
	
	public int modifications() {
		return indicies.length;
	}
	
	public int[] indicies() {
		return indicies;
	}
	
	public Object[] values() {
		return values;
	}

}
